home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / GRAPTIES / GIF2WPG.LZH / GIF2WPG.DOC next >
Text File  |  1988-11-21  |  11KB  |  285 lines

  1.  
  2.  
  3.  
  4.  
  5.               GIF2WPG V3.0 GIF -to- Word Perfect Graphics File Translator
  6.               Copyright 1988 by William J. Hinkle [71121,3211]
  7.                                 14 Oct 1988
  8.  
  9.  
  10.            GIF and 'Graphics Interchange Format' are trademarks of
  11.                          CompuServe, Incorporated.
  12.                             an H&R Block Company
  13.  
  14.                             === User's Guide === 
  15.  
  16. The GIF2WPG program  was created to allow graphics files created as GIF
  17. (Graphics Interchange Format) files to be used in Word Perfect documents.
  18. To do this, the program translates the GIF file into a WPG bit-mapped
  19. raster graphics file.  In the process, GIF2WPG converts the GIF image's
  20. colors into shades of gray, which it tries to reproduce in the WPG image.
  21.  
  22. There are zillions of GIF files available on CompuServe in the GO PICS
  23. forum, as well in other forums, and from other sources.  Generally they are
  24. in color, which GIF2WPG changes into grayscale and then dithers (default) or
  25. halftones.
  26.  
  27. The translator is a single file: GIF2WPG.EXE.
  28.  
  29. THE CATCH
  30. =========
  31. Note that this program is being released by the author, and is NOT supported
  32. by Word Perfect Corporation, or by CompuServe Inc.
  33.  
  34. It is NOT public domain!
  35.  
  36. In fact, if you use this utility extensively, the author will be glad to
  37. accept your contribution of $10.00 to offset costs of developing this program.
  38. If you use GIF2WPG in a commercial or business environment, please consider
  39. this imperative.  Please see the very end of this document for details!
  40.  
  41.  
  42.  
  43.  
  44. OPERATION
  45. =========
  46. First get a GIF file contains the graphics image you want to integrate into
  47. your document.  These are usually "paint" or "screen capture" images.  See
  48. GO PICS on CompuServe.  It should  have the standard .GIF file extension
  49. (i.e., fname.GIF).
  50.  
  51. To create a .WPG file, type in:
  52.  
  53. GIF2WPG fname
  54. or
  55. GIF2WPG fname.GIF
  56. or
  57. GIF2WPG fname.GIF fname.WPG
  58.  
  59. from the DOS command prompt.  The .GIF extension is assumed if you do not
  60. specify one.  The .WPG extension is assumed whether you specify one or not.
  61. The .WPG file name is made the same as the .GIF if not otherwise specified.
  62. Full DOS pathnames can be specified.  You can specify just a directory
  63. (ending in \) or a drive (ending in :) instead of the second filename; the
  64. WPG file will use the name of the GIF file, with a WPG extension, and be
  65. placed on that path.
  66.  
  67. The .GIF file will be translated to a .WPG file.
  68. The .GIF file will not be erased.  You can also specify scaling factors, but
  69. the defaults often work the best (see below).
  70.  
  71. Some GIF files are "interlaced" -- they are specially constructed for on-line
  72. viewing.  GIF2WPG can only process this type of GIF file if you specify the
  73. /hN or /dN options, where N is a decimal number.  See below for details.
  74. You'll get an error message mentioning this fact if you try to translate such
  75. a GIF file with the default settings.
  76.  
  77.  
  78.  
  79.  
  80.  
  81. COMPLEAT USAGE
  82. ==============
  83. If you invoke GIF2WPG from DOS without any other parameters, it will
  84. display the following help message.  This illustrates some of the
  85. other options:
  86.  
  87. -----
  88. GIF-to-WPG Translator: V3.1 ... Copyright 1988 by W.J.Hinkle
  89.  
  90. Press any key to get a little help...
  91.  
  92. (You press a key here!)
  93.  
  94. GIF-to-WPG Translator: V3.1 ... Copyright 1988 by W.J.Hinkle
  95.  
  96. Press any key to get a little help...
  97.  
  98. Usage: GIFWPG fname1 [fname2] [option] [option] ...
  99. where: fname1.GIF ... GIF format input file
  100.        fname2.WPG ... Word Perfect WPG file (default is fname1.WPG)
  101.        /iN        ... option: select sub-image N (default is 1)
  102.        /xN        ... option: x density = N pixels-per-inch
  103.        /yN        ... option: y density = N lines-per-inch
  104.        /v         ... option: reverse video
  105.        /hN        ... option: force halftone block to NxN
  106.        /dN        ... option: force dither block to NxN (<=0 =error diffused)
  107.        /cN        ... option: change contrast by N%
  108.        /l         ... option: linearize colors (ignore color maps)
  109.        /p         ... option: print pixel histogram data
  110.  
  111. GIFWPG is a translator from CompuServe GIF files to Word Perfect WPG
  112. graphics files.  The GIF colors are converted to grayscale intensity
  113. using the weighting: Red 30%, Green 59%, Blue 11%.  The grayscale is
  114. dithered error diffused by default.  A pattern block size can be selected
  115. with /dN, N=1,2,4 or 8, or halftone with /hN, N=1,2,3 or 4.
  116. The X density defaults to 100 pixels-per-inch times the halftone block
  117. size (if any), Y density set for 4/3 aspect ratio, unless set by /xN and /yN.
  118. GIF and 'Graphics Interchange Format' are trademarks of CompuServe Inc.
  119.  
  120. By: William J. Hinkle, CIS [71121,3211]
  121.  
  122. -----
  123. If your GIF file contains multiple sub-iamges, you can specify which one
  124. to extract and translate by specifying the /iN option, where N is the sub-
  125. image number 1,2,3... etc.  Normally, you can ignore this option; the 1st
  126. (or only!) image will be translated.  If there are additional sub-images
  127. beyond the one selected, a warning is issued and they are ignored.
  128.  
  129. Normally GIF2WPG decides that the image's X density (for width) is
  130. 100 pixels (or lines) per inch, times the halftone block size (see below).
  131. The Y density (for height) is set by by computing the density required to
  132. create a 4/3 aspect ratio in order to simulate a CRT screen.  This is done
  133. because most GIF images are a single full screen image.  This allows
  134. computation of a "natural" size for the graphics image.
  135.  
  136.  
  137.  
  138.  
  139. You can specify a different density by specifying the /xN option switch (e.g.
  140. /x300 is 300 pixels per inch horizontally).  The corresponding Y density is
  141. computed as above.  You can also alter the aspect ratio by specifying both
  142. the /x and /y option switches, with different density values.  The overrides
  143. are NOT further adjusted for halftoning or error-diffused multiplication!
  144.  
  145. Most, if not all, GIF files are in color.  GIF2WPG transforms the color
  146. mapping into intensity of grayscale using the above mentioned weights.
  147. Once in grayscale, the image can be either dithered (the default) or
  148. halftoned.
  149.  
  150. Dithering tries to average the image brightness over a small area of the
  151. image.  The default is to use double the size of the image in both axes,
  152. and use error-diffused dithering.  You can vary the multiplication factor
  153. by specifying the /dN option with a negative N, where N is the size multiplier.
  154. In other words, the default dithering is equivalent to /d-2.  This type of
  155. dithering tends to ease problems image artifacts if you later scale the image.
  156.  
  157. If you specify the /dN option with positive N (/d1, /d2, /d4, or /d8), the
  158. image size is not multiplied and a patterned dither is used with an NxN
  159. dither block.  This can give smaller WPG files, but not very good visual
  160. results.
  161.  
  162. A better option is halftoning, which replaces each GIF pixel with a block of
  163. on/off pixels that have a corresponding optical density.  Halftoning will be
  164. done instead of dithering if you specify the /hN option (which will halftone
  165. with an NxN block).  For example: /h1, /h2, /h3, or /h4.
  166.  
  167. Normally GIF2WPG flips the photometric interpretation of the GIF file colors:
  168. the brightest colors have the fewest pixels in the WPG file.  This is because
  169. GIF files are generally optimized for screen viewing, but Word Perfect will
  170. (eventually) put the image on paper.  However, if you want a reverse video
  171. effect, use the /v option switch.
  172.  
  173.  
  174.  
  175.  
  176. You can override the GIF file's color map by specifying the /l option (that's
  177. an "el", not a "one").  This "linearizes" the color mapping: color indices
  178. will be transformed directly into grayscale without worrying about how
  179. bright the colors really ought to be.  This sometimes gives a more detailed,
  180. though probably less accurate, image.
  181.  
  182. The /cN option can be specified to crudely adjust the contrast of the image
  183. before halftoning or dithering.  The effect is to multiply each grayscale
  184. intensity value by N%.  The factor N can be greater or less than 100.  If not
  185. specified, the contrast is left at 100%.  For example: /c85 give 85% contrast.
  186.  
  187. The /p option causes a histogram to be kept on the distribution of color
  188. indices in the GIF image.  The RGB levels and relative brightness of each
  189. color, as well as the number of occurences of each value, are printed on
  190. the screen when the translation is complete.  This can sometimes be helpful
  191. in adjusting the /cN contrast option.
  192.  
  193. EXAMPLES
  194. ========
  195. 1) Suppose you have a GIF file called "earthm.gif".  You want to create a WPG
  196. file version of this image without worrying about the details.  You can
  197. translate this to a WPG file by typing (at the DOS prompt):
  198.  
  199. GIF2WPG earthm
  200.  
  201. and you will see something like:
  202. -----
  203. GIF-to-WPG Translator: V3.0 ... Copyright 1988 by W.J.Hinkle
  204.  
  205. From GIF 640x350x16 file: earthm.gif
  206.   to WPG 1280x700 file: earthm.WPG
  207.   dithered error diffused with 100% contrast.
  208. "Natural" picture size is 6.400W x 4.800H inches.
  209. -----
  210. Note that both the GIF image resolution and color range are shown:
  211. GIF Width x Height x # of Colors
  212.  
  213. Also shown is the final WPG image resolution:
  214. WPG Width x Height
  215.  
  216. Also shown are the "natural" size of the final image, and the file names.
  217.  
  218.  
  219.  
  220.  
  221.  
  222. 2) Suppose you have a GIF file called "yikes.gif".  You can translate
  223. this to a WPG file by typing (at the DOS prompt):
  224.  
  225. GIF2WPG yikes /h4
  226.  
  227. and you will see something like:
  228. -----
  229. GIF-to-WPG Translator: V3.0 ... Copyright 1988 by W.J.Hinkle
  230.  
  231. From GIF 156x131x16 file: yikes.gif
  232.   to WPG 624x524 file: yikes.WPG
  233.   halftoned into a 4x4 pixel matrix with 100% contrast.
  234. "Natural" picture size is 1.560W x 1.170H inches.
  235. -----
  236.  
  237.  
  238. CAVEAT
  239. ======
  240. Should you have any difficulties using this program, you can contact
  241. me through CompuServe EMAIL to [71121,3211], if you like, or at the address
  242. below.  General feedback is welcome, especially on better methods of color
  243. reduction, grayscale halftoning and dithering, and problem GIF files.
  244.  
  245. Thanks to Bob Cancilla [76077,354] for his prototype testing & help on
  246. the original GIF2BIT for Lotus Manuscript.
  247. Thanks to Jeff Lewis [72717,1033] for ideas on halftoning and dithering.
  248. Thanks to Kyle Powell [76044,2215] for his public domain LZW decoder 85GIF.
  249. Thanks to Floyd & Steinberg for the error diffused dither algorithm.
  250.  
  251.  
  252.  
  253.  
  254. REVISION INFO
  255. =============
  256. *    Version number    Date        Explanation                                *
  257. *    --------------    ------        --------------------------                *
  258. *        3.0            14 Oct 88    Original Release, based on GIF2BIT V3.0    *
  259. *         3.1            21 Nov 88    Added color map & output attributes     *
  260.  
  261. COPYRIGHT INFO
  262. ==============
  263. This program GIF2WPG.EXE was written by
  264.  
  265.     William J. Hinkle
  266.  
  267. who retains the copyright.  All rights are reserved, except as follows.
  268.  
  269. Copy and use GIF2WPG.EXE and GIF2WPG.DOC freely.  Distribute it to whomever
  270. you want.  But:
  271.  
  272. === DO NOT distribute modified versions.
  273. === DO NOT remove the copyright notice.
  274. === ALWAYS distribute with the documentation.
  275.  
  276. If you feel that this program has been of some utility, feel free to send
  277. me a few bucks (say, $10.00) to help defray the CompuServe costs run up
  278. in developing this utility.  If you are using this program in a commercial
  279. environment, please consider this mandatory.
  280.  
  281. William J. Hinkle [71121,3211]
  282.  
  283. 420 E.Boston Mills Rd.
  284. Hudson, OH 44236-1111
  285.